<div class="mat-elevation-z1">
  <mat-toolbar>
    <span class="toolbar-title">交易所</span>
    <span class="spacer"></span>
  </mat-toolbar>

  <table mat-table class="full-width" matSort>

    <ng-container matColumnDef="index">
      <th mat-header-cell *matHeaderCellDef>#</th>
      <td mat-cell *matCellDef="let row; let index=index">
        {{index + 1}}
      </td>
    </ng-container>


    <ng-container matColumnDef="code">
      <th mat-header-cell *matHeaderCellDef mat-sort-header>代号</th>
      <td mat-cell *matCellDef="let row">{{row.code}}</td>
    </ng-container>

    <ng-container matColumnDef="name">
      <th mat-header-cell *matHeaderCellDef mat-sort-header>名称</th>
      <td mat-cell *matCellDef="let row">{{row.name}}</td>
    </ng-container>

    <ng-container matColumnDef="createdAt">
      <th mat-header-cell *matHeaderCellDef mat-sort-header>创建于</th>
      <td mat-cell *matCellDef="let row">{{row.createdAt | date:'y-MM-dd'}}</td>
    </ng-container>

    <ng-container matColumnDef="actions">
      <th mat-header-cell *matHeaderCellDef></th>
      <td mat-cell *matCellDef="let row" align="end">

        <button mat-button (click)="edit(row)">
          <mat-icon>edit</mat-icon>
          修改
        </button>

      </td>
    </ng-container>

    <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
    <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
  </table>

</div>
